feat(i18n): honor localize: [...] per-locale subset - #180
Merged
lukekania merged 1 commit intoMay 18, 2026
Conversation
Switch `--localize` from a bool flag to an optional comma-separated list so CI builds can emit just the locales they need. ngc-rs build --localize # all i18n.locales (unchanged) ngc-rs build --localize=en-US,de # only those two subdirs The architect builder now serializes `localize: ['en', 'de']` as `--localize=en,de` instead of dropping the array and warning. An empty array still falls back to "all locales" to match `@angular/build`. `fan_out_locales` validates each subset entry against the source locale and `i18n.locales` keys; an unknown locale fails the build with a clear error rather than silently producing an empty `dist/`.
lukekania
force-pushed
the
feat/i18n-localize-subset
branch
from
May 18, 2026 09:47
7751a2b to
b3654b6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the v0.11.0 builder-parity milestone. Issue links land on the milestone PR.
Summary
--localizeonbuild/watchswitches from a bool flag to an optional comma-separated list.--localize(no value) keeps current behaviour (all locales);--localize=en-US,derestricts the output to those two locale subdirectories.fan_out_localesfiltersi18n.localesagainst the requested subset, including/excluding the source-locale directory based on whether the source-locale code is in the subset.@ngc-rs/builder:application) now serializeslocalize: ['en', 'de']as--localize=en,deand drops the prior "subset not yet honoured" warning. An empty array is treated astrueto match@angular/build.ConfigErrorinstead of silently producing an emptydist/.Test plan
cargo build --release -p ngc-rscargo test -p ngc-rs(72 passed)cargo clippy --workspace -- -D warnings(clean)npm testinpackages/builder(66 passed)test-ng-projectwith a temporaryi18n.locales: { de }:--localize=de→ de subdir only--localize(no value) → both locale subdirs--localize=en-US,de→ both subdirs--localize=fr→ fails with "subset entryfris not declared"Notes